# define depends jarfiles name
libpath = './lib/'
api = libpath + 'appengine-api-1.0-sdk-1.3.0.jar'
labs = libpath + 'appengine-api-labs-1.3.0.jar'
stub = libpath + 'appengine-api-stubs.jar'
localruntime = libpath + 'appengine-local-runtime.jar'

# load? jarfiles
require api
require labs
require stub
require localruntime

# setup tool environment
apiproxy = Java::com.google.apphosting.api.ApiProxy
apiproxylocalimpl = Java::com.google.appengine.tools.development.ApiProxyLocalImpl
file = Java::java.io.File

apiProxyLocal = apiproxylocalimpl.new(file.new(''))
#apiProxyLocal.setProperty(LocalDatastoreService.NO_STORAGE_PROPERTY, Boolean.TRUE.toString());  
#apiProxy.setEnvironmentForCurrentThread(environment)
apiProxy.setDelegate(apiProxyLocal)

# call appengine api rawly 
byte = "this is sample byte".unpack("C*")
result = apiproxy.makeSyncCall('datastore_v3','Get', byte.to_java(:byte))
puts result

